﻿package {
	import org.flixel.*;
	
	public class PowerUp extends FlxSprite {
		public static const speedup:int = 0;
		public static const powerup:int = 1;
		public static const lifeup:int  = 2;
		public static const scoreup:int = 3;
		public static const triesup:int = 4;
		public var type:int;
		
		public function PowerUp(type:int, x:int, y:int) {
			super(x, y);
			createGraphic(10, 10);
			
			switch(type) {
				case speedup: loadGraphic(ResourceManager.speedup); break;
				case powerup: loadGraphic(ResourceManager.powerup); break;
				case lifeup: loadGraphic(ResourceManager.lifeup); break;
				case scoreup: loadGraphic(ResourceManager.scoreup); break;
				case triesup: loadGraphic(ResourceManager.triesup); break;
			}
			
			this.type = type;
			velocity.y = 50;
		}
		
		override public function update():void {
			super.update();
		}
		
		public function getTypeName():String 
		{
			switch(type) {
				case speedup: return this + ": Speed UP";
				case powerup: return this + ": Power UP";
				case lifeup:  return this + ": Life UP";
				case scoreup: return this + ": Score UP";
				case triesup: return this + ": Tries UP";
			}
			
			return "Unknown";
		}
	}
}